package com.homework.ch06;

public class Stu {
    private String name;
    private int age;
    private String classroom="软件82202";
    {
        classroom="w101";
        System.out.println(classroom);
    }
    private static int id;
    private static int count=200;
    static{
        id=1;
        count=100;
    }
    public Stu(){}
    public Stu(String name,int age,String classroom)
    {
        this.name=name;
        this.age=age;
        this.classroom=classroom;
    }
    public void setName(String name)
    {
        this.name=name;
    }
    static{
        System.out.println("静态代码块");
    }


    public void setAge(int age)
    {
        this.age=age;
    }
    {
        System.out.println("构造代码块");
    }
    public void setClassroom(String classroom)
    {
        this.classroom=classroom;
    }
    public String getName()
    {
        return this.name;
    }
    public int getAge()
    {
        return this.age;
    }
    public String getClassroom()
    {
        return this.classroom;
    }
    public static int getId()
    {
        return Stu.id;
    }
    public static int getCount()
    {
        return Stu.count;
    }
    public void show()
    {
        System.out.println("name:"+name+"\tage:"+age+"\tclassroom:"+classroom+"\tid:"+getId()+"\tcount:"+count);
    }
}
